<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=7" />
<title>后台管理中心</title>
{$system_css}
{$system_js}
</head>
<body>
{include file="message.html"}
<div class="pad-lr-10" style="margin-top: 15px;">
  <table width="100%" cellspacing="0" class="search-form">
    <tbody>
      <tr>
        <td><div class="explain-col">
            <form name="searchform" action="{$site_url}admin/post/search/" method="post" >
              &nbsp;&nbsp;选择分类：
              <select name="category_id" id="category_id">
                <option value="">==全部==</option>
                
                     {$category_option}     
                  
              </select>
              &nbsp;&nbsp;关键词：
              <input name="keywords" type="text"  class="input-text" />
              <input type="submit" name="search" class="button" value="搜索" />
            </form>
          </div></td>
      </tr>
    </tbody>
  </table>
  <div class="table-list">
    <table width="100%" cellspacing="0">
      <thead>
        <tr>
          <th width="45">ID</th>
          {if $is_answer ==1}
          <th>回复的内容</th>
          {else}
          <th>标题</th>
          {/if}
          <th>内容</th>
          <th>用户名</th>
          <th>添加时间</th>
          <th>管理操作</th>
        </tr>
      </thead>
      <tfoot>
        <tr align="right">
          <td colspan="5">{$page}</td>
        </tr>
      </tfoot>
      <tbody>
      
      {foreach from=$post_list item=list}
      <tr>
        <td align="center">{$list.id}</td>
        {if $is_answer ==1 || $is_comment ==1}
        <td align="center" width="25%">{$question_content} </td>
        {else}
        <td align="center" width="25%">{$list.name} </td>
        {/if}
        <td align="center" width="30%"><div style="width:200px;">{$list.content|truncate:50:'...'}</div></td>
        <td align="center" width="10%">{$list.username}</td>
        <td align="center">{$list.add_time|date:2}</td>
        <td align="center"> {if $is_answer !=1} <a href="{$site_url}admin/post/edit/{$list.id}">修改</a> |{/if} <a class="delete" href="javascript:void(0);" title="{$list.name}" id="{$list.id}">删除</a> | 
          {if $is_answer ==1} <a href="{$site_url}admin/post/comment_list/{$list.id}">评论列表</a> {elseif $is_comment ==1} {else}<a href="{$site_url}admin/post/answer_list/{$list.id}">回复列表</a> {/if} </td>
      </tr>
      {/foreach}
        </tbody>
      
    </table>
    <div id="pages"></div>
  </div>
</div>
<script type="text/javascript">
$(function(){
	$('.delete').click(function(){
		var title = $(this).attr('title');
		var id = $(this).attr('id');
		$.dialog.confirm('你确定要删除<font color=red>'+title+',所有回复和评论将同时被删除</font>？', function(){
			location.href="{$site_url}admin/post/delete/"+id;
		}, function(){
		});
	});
	
});
</script>
</body>
</html>